#ifndef _GA_HPP
#define _GA_HPP

#include <vector>
#include <GA\BinaryString\BinaryString.hpp>
#include <GA\Task\Factory\TaskFactory.hpp>
#include <GA\Task\Task.hpp>
#include <GA\operations\selection\Selector.hpp>
#include <GA\operations\mutation\Mutator.hpp>
#include <GA\operations\crossing\Crosser.hpp>
#include <GA\Task\Task.hpp>


#define MUTATION_PROB 0.01
#define ELIT_SIZE 4

namespace unitraf
{

//this define a class for evolutionary optimization
class GA
{
public:
	//constructors
	GA( size_t populationSize, TaskFactory* taskFactory, Task * task);
	BinaryString* best( ) const;
	~GA( );

	//methods
	void nextGen( );

	//members
protected:
	TaskFactory *_taskFactory;
	BinaryString **_population;
	size_t _populationSize;
	Task *_task;
	Selector *_selector;
	Mutator _mutator;
	Crosser *_crosser;
	size_t _elitSize;
	std::vector<ElemFit> fit;

};


} //namespace unitraf


#endif //#ifndef _GA_HPP